define(['./md5'], function(md5) {
    var colorMap = {};
    return function (str) {
        str = str || '';
        if(str in colorMap) return colorMap[str];

        var c = md5(str).charAt(0).toLowerCase();
        var color = ['#29d4ff', '#1594ff', '#ffa92f', '#b587fa', '#06cf86', '#fa6771', '#73d51c', '#8991ff'];
        var bg = color['abcdefghijklmnopqrstuvwxyz0123456789'.indexOf(c) % color.length];

        colorMap[str] = bg;
        return bg;
    }
})